<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>bagua</title>
    <style>
        body {
            background: darkgrey;
        }

        #bagua {
            height: 200px;
            width: 200px;
            border-radius: 50%;
            background: linear-gradient(to bottom, #ffffff 0%, #ffffff 49%, #000000 51%, #000000 100%);
            position: relative;
            margin: 100px auto;
        }

        .left {
            height: 100px;
            width: 100px;
            border-radius: 50%;
            position: absolute;
            top: 50px;
            background: #000000;
        }

        .right {
            height: 100px;
            width: 100px;
            border-radius: 50%;
            position: absolute;
            top: 50px;
            left: 100px;
            background: white;
        }

        .left .left_circle {
            height: 30px;
            width: 30px;
            border-radius: 50%;
            background: #ffffff;
            position: absolute;
            top: 35px;
            left: 35px;
        }

        .right .right_circle {
            height: 30px;
            width: 30px;
            border-radius: 50%;
            background: black;
            position: absolute;
            top: 35px;
            left: 35px;
        }

        /* div写法 */
        #yinyang {
            height: 200px;
            width: 200px;
            border-radius: 50%;
            background: linear-gradient(to bottom, #ffffff 0%, #ffffff 49%, #000000 51%, #000000 100%);
            position: relative;
            margin: 0 auto;
        }

        #yinyang::before {
            content: '';
            height: 30px;
            width: 30px;
            border-radius: 50%;
            border: 35px solid black;
            position: absolute;
            background: white;
            top: 50px;
        }

        #yinyang::after {
            content: '';
            height: 30px;
            width: 30px;
            border-radius: 50%;
            border: 35px solid white;
            position: absolute;
            background: black;
            top: 50px;
            left: 100px;

        }
    </style>
</head>

<body>
    <div id="bagua">
        <div class="left">
            <div class="left_circle"></div>
        </div>
        <div class="right">
            <div class="right_circle"></div>
        </div>
    </div>
    <div id="yinyang">

    </div>
</body>

</html>